package io.gitee.xyuesheng.day05;

import org.junit.Assert;
import org.junit.Test;

public class TestLinkedList {
    @Test
    public void test1() {
        LinkedList list = new MyLinkedList();

        list.add("add");
        list.add("efg");

//        System.out.println(list.size());
//        System.out.println(list.get(0));
//        System.out.println(list.get(1));

        Assert.assertEquals("abc", list.get(0));
        Assert.assertEquals("efg", list.get(1));

        try {
            list.get(-1);
            Assert.fail("没有报异常");
        } catch (Exception e) {
        }

        list.get(-2);

        Assert.assertEquals(2, list.size());
    }


}
